<?php
/**
 * Created by PhpStorm.
 * User: DELL-PC
 * Date: 2018/8/2
 * Time: 12:16
 */

namespace J\Schema\Collection;


use J\Schema\CollectionManager;
use J\Exception;

interface ICollection extends \J\Schema\ICollection
{
    /**
     * @param string $name
     * @return ICollection
     * @throws Exception
     */
    public function getCollection($name);

    /**
     * 插入或修改操作数据验证
     *
     * @param array $expression 表达式列表
     * @param bool  $edit 增/改
     * @return array|bool
     * @throws Exception
     */
    // public function mapElements($expression, $edit = true);

    /**
     * 填充数据
     *
     * @param array $rs
     * @param array $locals
     * @return array
     */
    // public function fillElement($rs, array $locals);

    /**
     * 唯一性
     *
     * @param string $element
     * @param mixed $value
     * @return bool
     */
    public function unique($element, $value);

    /**
     * 外键
     *
     * @param string $name
     * @return mixed
     */
    public function belongs($name);

    /**
     * 内部表
     * @return CollectionManager
     */
    public function inners();

    /**
     * 表名
     * @return string
     */
    public function getTableName();

    /**
     * @return CollectionManager
     */
    public function getCollections();


}